package com.llmcu.graphic.designpatterns.mediator;

import javax.swing.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

/**
 * xxxx
 *
 * @author liuling
 * @date 2024/7/21 10:47
 */
public class LoginCheckBox extends JCheckBox implements Colleague, ItemListener {
    private Mediator mediator;

    public LoginCheckBox(String text, boolean selected) {
        super(text, selected);
    }

    @Override
    public void setMediator(Mediator mediator) {
        this.mediator= mediator;
    }

    @Override
    public void itemStateChanged(ItemEvent e) {

        mediator.colleagueChanged();
    }
}
